package com.chixing.day02;

import java.util.Scanner;

public class StringDemo {
    public static void main(String[] args) {
        String result = "https://search.51job.com";
        //workyear=02&cotype=99&degreefrom=03&jobterm=99&companysize=99&ord_field=0&dibiaoid=0&line=&welfare=
        String[] workYearArr = {"所有", "在校生/应届生", "1-3年", "3-5年", "5-10年", "10年以上", "无需经验"};
        String[] salaryArray = {"所有", "2k以下", "2-4k", "4-5k", "5-7k", "7-9k", "9-10k", "10k以上"};
        String[] degreeArray = {"所有", "初中及以下", "高中/中专/大专", "本科", "硕士", "博士", "无学历要求"};
        String[] companyTypeArray = {"所有", "国企", "外资", "上市公司", "合资", "民营企业", "央企"};

        int workYearIndex = 1;  // 选择了 "在校生/应届生"
        int salaryIndex = 2;   // 选择了 "2-4k"
        int degreeIndex = 4;   // 选择了 "硕士"
        int companyTypeIndex = 2; // 选择了 "外资"

        if(workYearIndex>0 && (workYearIndex>=workYearArr.length-1))
            result += "?workYear=" + workYearArr[workYearIndex];

        if(salaryIndex>0 && (salaryIndex>=salaryArray.length-1))
            result += "&degree=" + salaryArray[salaryIndex];

        if(degreeIndex>0 && (degreeIndex>=degreeArray.length-1))
            result += "&degree=" + degreeArray[degreeIndex];

        if(companyTypeIndex>0 && (companyTypeIndex>=companyTypeArray.length-1))
            result += "&companyType=" + companyTypeArray[companyTypeIndex];

        System.out.println(result);





//        result += "?workYear=在校生/应届生&minsalary=2000&maxsalary=4000&degree=硕士&companyType=外资";
//        System.out.println(result);





        // 若以上选择了所有，则不传值
//        workYear = 1;
//        salary = 0;
//        degree = 0;
//        companyType = 2;

        result += "?workYear=在校生/应届生&companyType=外资";
//        String[] result2={workYearArr[workYear],salaryArray[salary],degreeArray[degree],companyTypeArray[companyType]};
//        for(int i=0;i<result2.length;i++){
//            if(result2[i]=="所有"){
//                String  res=" ";
//            }
//            System.out.print(result2[i] +" \t");
//        }


    }
}
